package com.me.learnspring.model;


import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.*;
import org.hibernate.annotations.Type;
import org.joda.money.Money;

import javax.persistence.*;
import java.util.List;

@Entity
@Data
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
@ToString(callSuper = true)
@Builder
public class Drink extends BaseEntity {
	
	// @ManyToMany
	// @JoinTable(
	// 	name = "order_drink",
	// 	joinColumns = {@JoinColumn(name = "items_id")},
	// 	inverseJoinColumns = {@JoinColumn(name = "drink_order_od")}
	// )
	// private List<Order> drinkOrder;
	
	@ManyToOne
	private Category category;
	private String name;
	
	@Type(
		type = "org.jadira.usertype.moneyandcurrency.joda.PersistentMoneyMinorAmount",
		parameters = {@org.hibernate.annotations.Parameter(name = "currencyCode",value = "CNY")}
	)
	private Money price;
	
}
